<template>
  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>
<script setup lang="ts">
// 解决ERROR ResizeObserver loop completed with undelivered notifications.

//问题的
import locale from 'element-plus/es/locale/lang/zh-cn'
import { useDebounceFn } from '@vueuse/core'
import { useTheme } from './hooks/useTheme'

// 解决ERROR ResizeObserver loop completed with undelivered notifications.
const _ResizeObserver = window.ResizeObserver

window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
  constructor(callback) {
    callback = useDebounceFn(callback, 16)

    super(callback)
  }
}

// init theme
const { initTheme } = useTheme()
initTheme()
</script>

<style lang="less"></style>
